//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.itheima.pinda.authority.entity.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.authority.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;

@TableName("pd_auth_role")
@ApiModel(
        value = "Role",
        description = "角色"
)
public class Role extends Entity<Long> {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("角色名称")
    @NotEmpty(
            message = "角色名称不能为空"
    )
    @Length(
            max = 30,
            message = "角色名称长度不能超过30"
    )
    @TableField(
            value = "name",
            condition = "%s LIKE CONCAT('%%',#{%s},'%%')"
    )
    private String name;
    @ApiModelProperty("角色编码")
    @Length(
            max = 20,
            message = "角色编码长度不能超过20"
    )
    @TableField(
            value = "code",
            condition = "%s LIKE CONCAT('%%',#{%s},'%%')"
    )
    private String code;
    @ApiModelProperty("功能描述")
    @Length(
            max = 100,
            message = "功能描述长度不能超过100"
    )
    @TableField(
            value = "describe_",
            condition = "%s LIKE CONCAT('%%',#{%s},'%%')"
    )
    private String describe;
    @ApiModelProperty("状态")
    @TableField("status")
    private Boolean status;
    @ApiModelProperty("是否内置角色")
    @TableField("readonly")
    private Boolean readonly;

    public Role(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime, String name, String code, String describe, Boolean status, Boolean readonly) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.name = name;
        this.code = code;
        this.describe = describe;
        this.status = status;
        this.readonly = readonly;
    }

    public static Role.RoleBuilder builder() {
        return new Role.RoleBuilder();
    }

    public String getName() {
        return this.name;
    }

    public String getCode() {
        return this.code;
    }

    public String getDescribe() {
        return this.describe;
    }

    public Boolean getStatus() {
        return this.status;
    }

    public Boolean getReadonly() {
        return this.readonly;
    }

    public Role setName(final String name) {
        this.name = name;
        return this;
    }

    public Role setCode(final String code) {
        this.code = code;
        return this;
    }

    public Role setDescribe(final String describe) {
        this.describe = describe;
        return this;
    }

    public Role setStatus(final Boolean status) {
        this.status = status;
        return this;
    }

    public Role setReadonly(final Boolean readonly) {
        this.readonly = readonly;
        return this;
    }

    public Role() {
    }

    public Role(final String name, final String code, final String describe, final Boolean status, final Boolean readonly) {
        this.name = name;
        this.code = code;
        this.describe = describe;
        this.status = status;
        this.readonly = readonly;
    }

    public String toString() {
        return "Role(super=" + super.toString() + ", name=" + this.getName() + ", code=" + this.getCode() + ", describe=" + this.getDescribe() + ", status=" + this.getStatus() + ", readonly=" + this.getReadonly() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Role)) {
            return false;
        } else {
            Role other = (Role)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                label73: {
                    Object this$name = this.getName();
                    Object other$name = other.getName();
                    if (this$name == null) {
                        if (other$name == null) {
                            break label73;
                        }
                    } else if (this$name.equals(other$name)) {
                        break label73;
                    }

                    return false;
                }

                Object this$code = this.getCode();
                Object other$code = other.getCode();
                if (this$code == null) {
                    if (other$code != null) {
                        return false;
                    }
                } else if (!this$code.equals(other$code)) {
                    return false;
                }

                label59: {
                    Object this$describe = this.getDescribe();
                    Object other$describe = other.getDescribe();
                    if (this$describe == null) {
                        if (other$describe == null) {
                            break label59;
                        }
                    } else if (this$describe.equals(other$describe)) {
                        break label59;
                    }

                    return false;
                }

                Object this$status = this.getStatus();
                Object other$status = other.getStatus();
                if (this$status == null) {
                    if (other$status != null) {
                        return false;
                    }
                } else if (!this$status.equals(other$status)) {
                    return false;
                }

                Object this$readonly = this.getReadonly();
                Object other$readonly = other.getReadonly();
                if (this$readonly == null) {
                    if (other$readonly != null) {
                        return false;
                    }
                } else if (!this$readonly.equals(other$readonly)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof Role;
    }

    public int hashCode() {
        Boolean PRIME = true;
        int result = super.hashCode();
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        Object $code = this.getCode();
        result = result * 59 + ($code == null ? 43 : $code.hashCode());
        Object $describe = this.getDescribe();
        result = result * 59 + ($describe == null ? 43 : $describe.hashCode());
        Object $status = this.getStatus();
        result = result * 59 + ($status == null ? 43 : $status.hashCode());
        Object $readonly = this.getReadonly();
        result = result * 59 + ($readonly == null ? 43 : $readonly.hashCode());
        return result;
    }

    public static class RoleBuilder {
        private Long id;
        private Long createUser;
        private LocalDateTime createTime;
        private Long updateUser;
        private LocalDateTime updateTime;
        private String name;
        private String code;
        private String describe;
        private Boolean status;
        private Boolean readonly;

        RoleBuilder() {
        }

        public Role.RoleBuilder id(final Long id) {
            this.id = id;
            return this;
        }

        public Role.RoleBuilder createUser(final Long createUser) {
            this.createUser = createUser;
            return this;
        }

        public Role.RoleBuilder createTime(final LocalDateTime createTime) {
            this.createTime = createTime;
            return this;
        }

        public Role.RoleBuilder updateUser(final Long updateUser) {
            this.updateUser = updateUser;
            return this;
        }

        public Role.RoleBuilder updateTime(final LocalDateTime updateTime) {
            this.updateTime = updateTime;
            return this;
        }

        public Role.RoleBuilder name(final String name) {
            this.name = name;
            return this;
        }

        public Role.RoleBuilder code(final String code) {
            this.code = code;
            return this;
        }

        public Role.RoleBuilder describe(final String describe) {
            this.describe = describe;
            return this;
        }

        public Role.RoleBuilder status(final Boolean status) {
            this.status = status;
            return this;
        }

        public Role.RoleBuilder readonly(final Boolean readonly) {
            this.readonly = readonly;
            return this;
        }

        public Role build() {
            return new Role(this.id, this.createUser, this.createTime, this.updateUser, this.updateTime, this.name, this.code, this.describe, this.status, this.readonly);
        }

        public String toString() {
            return "Role.RoleBuilder(id=" + this.id + ", createUser=" + this.createUser + ", createTime=" + this.createTime + ", updateUser=" + this.updateUser + ", updateTime=" + this.updateTime + ", name=" + this.name + ", code=" + this.code + ", describe=" + this.describe + ", status=" + this.status + ", readonly=" + this.readonly + ")";
        }
    }
}
